const Sequelize = require('sequelize')
const sequelize = require('../config/index')
const User = require('./user').User
let User_verify_progress = sequelize.define('user_verify_progress',{
    id:{
        type:Sequelize.INTEGER,
        primaryKey: true,
        autoIncrement: true,
        comment:'id',
    },

/*   Personal information
    Preferences
    Education background
    work experience
    Works and skills*/
    user_info:{
        type:Sequelize.INTEGER,
        defaultValue:0,
        comment:'用户信息',
    },
    work_skill:{
        type:Sequelize.INTEGER,
        defaultValue:0,
        comment:'工作与技能 0 1',
    },
    job_experience:{
        type:Sequelize.INTEGER,
        defaultValue:0,
        comment:'工作经历 0  1 已完成 未完成'
    },
    preferences:{
        type:Sequelize.INTEGER,
        defaultValue:0,
        comment:'偏好设置 0  1 已设置 未设置'
    },
    education:{
        type:Sequelize.INTEGER,
        defaultValue:0,
        comment:'教育背景 0  1 已完成 未完成'
    },
},{
    // freezeTabelName 为 true 时不会在库中映射表时增加复数表名
    // 该选项为 true 时，user 在映射时映射成 user，而为 false 时会映射成users
    freezeTableName: true,
})
User_verify_progress.belongsTo(User,{foreignKey: "uid"});
// Skill.belongsToMany(User, {through : 'userSkill'});
//这会创建一个新模型UserProject,其中projectId和userId两个外键。定义through选项后，Sequelize会尝试自动生成名字。
//在本例中，会为User添加方法getUsers,setUsers,addUser,addUsers到Project中。getProjects,setProjects,addProject,addProjects到User中.


let user_verify_progress = User_verify_progress.sync();

module.exports = User_verify_progress

